﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ACH
{
    public partial class PositionTypes : Form
    {
        public PositionTypes()
        {
            InitializeComponent();
        }

        private void PositionTypes_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'aCHDataSet.PositionTypes' table. You can move, or remove it, as needed.
            this.positionTypesTableAdapter.Fill(this.aCHDataSet.PositionTypes);

        }

        private void fillByToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.positionTypesTableAdapter.FillBy(this.aCHDataSet.PositionTypes);
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }

        }

        private void bindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            bindingSource1.EndEdit();
            positionTypesTableAdapter.Update(aCHDataSet.PositionTypes);
        }

        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            Helper.CreateNew(bindingSource1);
        }
        
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            positionTypesTableAdapter.Update(aCHDataSet.PositionTypes);
        }
    }
}
